#include<iostream>
using namespace std;



class Date
{
private:
	int _year;
	int _month;
	int _day;
public:
	Date(int year = 2023, int month = 10, int day = 23)
	{
		_year = year;
		_month = month;
		_day = day;
	}
	void Print()
	{
		cout << _year << '-' << _month << '-' << _day << endl;
	}
};

class Stack
{
private:
	int* _a;
	int _size;
	int _capacity;
public:
	Stack(int capacity = 3)
	{
		_a = (int*)malloc(sizeof(int) * capacity);
		_size = 0;
		_capacity = capacity;
	}
	Stack(Stack& a)
	{
		_a = (int*)malloc(sizeof(int)*a._capacity);
		_size = a._size;
		_capacity = a._capacity;
		for (int i = 0; i < a._size; i++)
		{
			_a[i] = a._a[i];
		}
	}
	void Print()
	{
		for (int i = 0; i < _size; i++)
		{
			cout << _a[i] << "   ";
		}
		cout << endl;
	}

	void push(int x)
	{
		_a[_size++] = x;
	}

	~Stack()
	{
		free(_a);
		_a = NULL;
		_size = _capacity = 0;
	}
};

void fun(Date a)
{
	a.Print();
}

void fun2(Stack& m)
{
	m.Print();
}

int main()
{
	Date a;
	Stack b;
	b.push(1);
	b.push(2);
	b.push(3);
	Stack m(b);
	m.Print();
	return 0;
}